package com.editoken.mp.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.editoken.mp.domain.po.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;


// mybits 通过 mappper.xml 实现 Mapper实现类
public interface UserMapper extends BaseMapper<User> {

    void updateBalanceByIds(@Param("ew") QueryWrapper<User> queryWrapper, @Param("amount") int amount);

    @Update("UPDATE tb_user set balance = balance - #{money} WHERE id = #{id}")
    void deductBalance(@Param("id") Long id, @Param("money") Integer money);
}
